package com.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.bean.User;
import com.dao.UserDAO;
import com.service.UserService;
 
 
 
@Service
public class UserServiceImpl implements UserService{
 
    @Autowired
    @Qualifier("userDAO")
    private UserDAO userDAO;
     
    public int insertUser(User user) {
        // TODO Auto-generated method stub
        return userDAO.insertUser(user);
    }
    
    public int updateUser(User user) {
        // TODO Auto-generated method stub
        return userDAO.updateUser(user);
    }
    
    public int deleteUser(String name) {
        // TODO Auto-generated method stub
        return userDAO.deleteUser(name);
    }
    
    public List<User> selectUser(int pageSize,int pageIndex,String SearchSql){
        // TODO Auto-generated method stub
        return userDAO.selectUser(pageSize, pageIndex, SearchSql);
    }

	public User selectOne(String username, String password) {
		System.out.println(username+"----------------------------");
		return userDAO.selectOne(username, password);
	}


	public List<User> selectAllByid() {
		// TODO Auto-generated method stub
		return userDAO.selectAllByid();
	}
	public User selectById(Integer userid) {
		return userDAO.selectById(userid);
	}

	public User selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return userDAO.selectByPrimaryKey(id);
	}

	public List<User> selectAllUser(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return userDAO.selectAllUser(map);
	}
	
	 public void insertSelective(User user) {
         userDAO.insertSelective(user);
    }

	public void deleteById(Integer id) {
		userDAO.deleteByPrimaryKey(id);
	}
	public void updateByPrimaryKeySelective(User user) {
		userDAO.updateByPrimaryKeySelective(user);
	}
}
